home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Mark Pilgrim / Jotto ][ 1.2 / source / Wipes ƒ / HGR.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  939 b   |  38 lines  |  [TEXT/MMCC]

  1. #include "timing.h"
  2.  
  3. #define CorrectTime 4
  4. #define theWindowWidth (boundsRect.right-boundsRect.left)
  5. #define theWindowHeight (boundsRect.bottom-boundsRect.top)
  6.  
  7. pascal short HGR(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect);
  8.  
  9. /* Copy even-numbered rows starting at the top and moving down, and copy odd-
  10.    numbered rows starting at the bottom and moving up. */
  11.    
  12. pascal short HGR(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect)
  13. {
  14.     Rect            thisone;
  15.     short                i;
  16.     short                numRows;
  17.     
  18.     numRows=theWindowHeight/24;
  19.     for (i=0; i<numRows; i++)
  20.     {
  21.         StartTiming();
  22.         
  23.         SetRect(&thisone, boundsRect.left, boundsRect.top+i, boundsRect.right,
  24.             boundsRect.top+i+1);
  25.         
  26.         while (thisone.top<boundsRect.bottom)
  27.         {
  28.             CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  29.                 &thisone, &thisone, 0, 0L);
  30.             thisone.top+=numRows;
  31.             thisone.bottom+=numRows;
  32.         }
  33.         TimeCorrection(CorrectTime);
  34.     }
  35.     
  36.     return 0;
  37. }
  38.